package cn.itsource.org.mapper;

import cn.itsource.org.domain.Menu;
import cn.itsource.org.domain.Role;
import cn.itsource.common.mapper.BaseMapper;
import cn.itsource.org.dto.RoleMenuDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Tom
 * @since 2024-03-08
 */
public interface RoleMapper extends BaseMapper<Role> {

    void saveRoleAndMenu(@Param("roleId") Long roleId,@Param("menus") List<Long> menus);

    void saveRoleAndPermissions(@Param("roleId") Long roleId,@Param("permissions") List<Long> permissions);

    List<Menu> findRoleAndMenu(Long roleId);

    List<Long> findRoleAndPermissions(Long roleId);

    void deleteRoleMenuByRoleId(Long id);

    void deleteRolePermissionsByRoleId(Long id);
}
